package com.jhgsys.internal.workflow.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

/**
 * 流程申请表 Entity
 *
 * @author fenghaijun
 * @date 2024-07-19 13:53:28
 */
@Data
@TableName("workflow_apply")
public class WorkflowApply implements Serializable {

    /**
     * 主键
     */
    @TableId(value = "workflow_apply_id", type = IdType.ASSIGN_UUID)
    private String workflowApplyId;

    /**
     * 租户Id
     */
    @TableField("tenant_id")
    @NotNull(message = "{required}")
    private String tenantId;

    /**
     * 流程Id
     */
    @TableField("workflow_id")
    @NotNull(message = "{required}")
    private String workflowId;

    /**
     * 流程名称
     */
    @TableField("workflow_name")
    @NotBlank(message = "{required}")
    @Size(max = 255, message = "{noMoreThan}")
    private String workflowName;

    /**
     * 申请编号
     */
    @TableField("workflow_apply_no")
    @NotBlank(message = "{required}")
    @Size(max = 64, message = "{noMoreThan}")
    private String workflowApplyNo;

    /**
     * 1：事故调查审核 2：事故整改审核 3：违章登记审核 4：隐患上报审核/签发 5：开单额度审核 6：安全奖励审核
     */
    @TableField("workflow_business")
    @NotBlank(message = "{required}")
    @Size(max = 64, message = "{noMoreThan}")
    private String workflowBusiness;

    /**
     * 业务Id
     */
    @TableField("business_id")
    @NotNull(message = "{required}")
    private String businessId;

    /**
     * 申请人
     */
    @TableField("workflow_apply_user_id")
    @NotBlank(message = "{required}")
    @Size(max = 32, message = "{noMoreThan}")
    private String workflowApplyUserId;

    /**
     * 申请姓名
     */
    @TableField("workflow_apply_user_name")
    @NotBlank(message = "{required}")
    @Size(max = 90, message = "{noMoreThan}")
    private String workflowApplyUserName;

    /**
     * 流程状态;1：待提交 2：待审核 3：审核中 4：已退回 5：已拒绝 6：已完成
     */
    @TableField("workflow_apply_status")
    @NotBlank(message = "{required}")
    @Size(max = 2, message = "{noMoreThan}")
    private String workflowApplyStatus;

    /**
     * 上一个节点Id
     */
    @TableField("last_workflow_node_id")
    private String lastWorkflowNodeId;

    /**
     * 上一个节点
     */
    @TableField("last_workflow_node_name")
    @Size(max = 90, message = "{noMoreThan}")
    private String lastWorkflowNodeName;

    /**
     * 上一个节点审核时间
     */
    @TableField("last_workflow_node_review_date")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date lastWorkflowNodeReviewDate;

    /**
     * 当前流程节点
     */
    @TableField("workflow_node_id")
    private String workflowNodeId;

    /**
     * 节点是否加签;0：否 1：是
     */
    @TableField("node_before_review_flg")
    @Size(max = 1, message = "{noMoreThan}")
    private String nodeBeforeReviewFlg;

    /**
     * 新增人
     */
    @TableField("created_by")
    @Size(max = 90, message = "{noMoreThan}")
    private String createdBy;

    /**
     * 新增时间
     */
    @TableField("created_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime;

    /**
     * 修改人
     */
    @TableField("updated_by")
    @Size(max = 32, message = "{noMoreThan}")
    private String updatedBy;

    /**
     * 修改时间
     */
    @TableField("updated_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedTime;

    /**
     * 删除人
     */
    @TableField("deleted_by")
    @Size(max = 32, message = "{noMoreThan}")
    private String deletedBy;

    /**
     * 删除时间
     */
    @TableField("deleted_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date deletedTime;

    /**
     * 删除标记
     */
    @TableField("deleted_flg")
    @Size(max = 1, message = "{noMoreThan}")
    private String deletedFlg;

}